# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=py3-calver
pkgver=2022.06.26
pkgrel=3
pkgdesc="Setuptools extension for CalVer package versions"
url="https://github.com/di/calver"
license="Apache-2.0"
arch="noarch"
depends="python3"
makedepends="py3-gpep517 py3-installer py3-setuptools py3-wheel"
checkdepends="py3-pretend"
subpackages="$pkgname-pyc"
source="https://github.com/di/calver/archive/$pkgver/py3-calver-$pkgver.tar.gz
	version-placeholder.patch"
builddir="$srcdir/calver-$pkgver"
options="!check" #pytest circular dep

prepare() {
	default_prepare

	# set module version
	sed "s/@VERSION@/$pkgver/" -i setup.py
}

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	PYTHONPATH=build/lib pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
4d436cead8930cae1a71eddef9f0ecd2881f8cb632c3814dc75390b061a909e7ca969a604a5fded1c66647947856d540e2180bd3ce4bed5087b4dbc9d5edb393  py3-calver-2022.06.26.tar.gz
32920f16e7efd7a463b1ff2fc584d348a92e33ea4ced27678fb8740c72de722da23ceab83dc9855d31e86fd7f617a92eb6ebbac351fa9596c0f2e9f401bd6ada  version-placeholder.patch
"
